{extend name="public:layout" /}
{block name="title"}添加{$moudleName}{/block}
{block name="head"}{/block}
{block name="body"}
<div class="wrapper wrapper-content">
    <div class="ibox">
        <div class="ibox-title">
            <ol class="breadcrumb">
                <li>
                    <i class="fa fa-hand-o-right"></i>
                    <a href="{:url('index',['mid'=>$Request.param.mid,'cid'=>$Request.param.cid])}">{$moudleName}列表</a>
                </li>
                <li class="active">添加{$moudleName}</li>
            </ol>
        </div>
        <div class="ibox-content">
            <form method="post" class="form-horizontal" id="form">
                <div class="form-group">
<label class="col-sm-2 control-label Validform_label">结算单号</label>
<div class="col-sm-3">
    {:widget('common\/Form\/selectpage',['sum_odd','','widget|common\/Form\/selectpage|keyField:aid|showField:car_sn|multiple:false|searchField:order_start_time|order_start_time:出车时间|dbTable:car_order'])}
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label Validform_label">费用类型</label>
<div class="col-sm-8">
    {:widget('common/Form/custombox',['spend_type','','widget|common/Form/custombox|radio:dict:dict_name,dict_name:type_id=112:===请选择=== '])}
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label Validform_label">费用金额</label>
<div class="col-sm-3">
    <input class="form-control" type="text" placeholder="费用金额" name="spend_money" value="0" datatype="*" />
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label Validform_label">加油升数</label>
<div class="col-sm-3">
    <input class="form-control" type="text" placeholder="加油升数" name="spend_oil_sum" value="0"  />
</div>
<label class="col-sm-2 control-label Validform_label">油费单价</label>
<div class="col-sm-3">
    <input class="form-control" type="text" placeholder="油费单价" name="spend_oil_price" value="0"  />
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label Validform_label">付款时间</label>
<div class="col-sm-3">
    <input class="form-control laydatetime" type="text" placeholder="付款时间" name="spend_time" value="" />
</div>
<script>formatDate();</script>
</div>
<div class="form-group">
<label class="col-sm-2 control-label Validform_label">备注</label>
<div class="col-sm-8">
    <textarea class="form-control" rows="3" name="spend_desc" ></textarea>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label Validform_label">排序</label>
<div class="col-sm-3">
    <input class="form-control" type="text" placeholder="" name="sort" value="0"  />
</div>
</div>

                <div class="form-group">
                    <div class="col-sm-10 col-sm-offset-2">
                        <button class="btn btn-primary" id="btnSub" type="button">保存</button>
                        <a href="{:url('index',['mid'=>$Request.param.mid])}" class="btn btn-white">取消</a>
                        <span id="validError"></span>
                    </div>
                </div>
            </form>
        </div>
    </div>
</div>
{/block}
{block name="script"}
<script type="text/javascript">
    $(function () {
        iCheck();
        formatDate();
        ajaxSubForm('#btnSub');
    });
    
    setTpl();
        In('icheck',function () {
            iCheck();
            $("input[name='cat_type']").on('ifChecked', function(event){
                setTpl();
            });
            $("input[name='is_batch']").on('ifChanged', function (event) {
                if($(this).prop('checked')){
                    $('.two').show();
                    $('.one').hide();
                }else{
                    $('.two').hide();
                    $('.one').show();
                }
            });
        })
    })
    function setTpl() {
        var catTpl = $('input[name="cat_type"]:checked ').data('tpl');
        $("input[name='cat_tpl']").val(catTpl);
    }
</script>
{/block}